home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / May 96 / Re Why NULL.1 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.1 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Why NULL
  2. Sent:        5/23/96 9:52 PM
  3. Received:    5/24/96 8:49 AM
  4. From:        Jim Lloyd, jim@melongem.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. At 7:23 PM 5/23/96, Serge Froment wrote:
  9. >Dear ODF Team:
  10. >
  11. >Why does ODF defines a NULL macro instead of using C++'s nil? I
  12. >suppose there is a good reason, but I cannot figure it out...
  13. >
  14. >Serge
  15.  
  16. Damon beat me to it, but I'll add my two bits anyway. The proposed ANSI/ISO
  17. specification for C++ does not define "nil" anywhere.  It does define NULL,
  18. as a macro, but only as a concession for compatibility with C.  The macro
  19. should be simply:
  20.  
  21. #define NULL 0
  22.  
  23. Note that it should NOT be any of the following:
  24.  
  25. #define NULL ((void*)0)
  26. #define NULL 0L
  27.  
  28. This is due to the fact that the specification says that only 0 can be
  29. implicitly converted to a pointer to any type T*.  There is a significant
  30. minority of people in the C++ community that believe that NULL should be
  31. deprecated, and 0 always used instead.
  32.  
  33. Jim Lloyd
  34.  
  35.  
  36.  
  37.